package com.infore.dataReceiving.repository;
import java.util.List;

import javax.transaction.Transactional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import com.infore.dataReceiving.entity.CheckData;

@Repository
public interface ICheckDataRepository extends JpaRepository<CheckData, String>, JpaSpecificationExecutor<CheckData>  {

	
	public List<CheckData> findByUpdateFlagIsNullOrderByDataTimeDesc();
	
	@Modifying
	@Transactional 
	@Query(nativeQuery = true,value = "UPDATE CHECK_DATA SET UPDATE_FLAG = :flag "
			+ "WHERE CHECK_ID IN (:ids) ")
	int updateCheckData(@Param("flag")String flag, @Param("ids") List<String> ids);
}
